<template>
    <div class="article-page">
      <!-- 文章头部 -->
      <div class="article-header">
        <h1 class="title">新手入门：美食摄影的光线运用技巧</h1>
        <div class="meta-info">
          <span class="author">作者：张美食摄影</span>
          <span class="publish-date">发布日期：2024-03-15</span>
          <span class="views">👁 浏览 2845</span>
          <span class="likes">❤️ 点赞 {{like}}</span>
        </div>
      </div>
  
      <!-- 文章内容 -->
      <div class="article-content">
        <img src="" alt="示例照片" class="content-img">
        <div class="content-text">
          <p>想要拍出让人垂涎欲滴的美食照片？掌握光线是关键。自然光是美食摄影的首选光源...</p>
          <h2>一、自然光的使用技巧</h2>
          <p>最佳拍摄时间是上午10点或下午3点的柔光时段，避免正午的强烈直射光...</p>
          <h2>二、人造光的设置</h2>
          <p>使用柔光箱或反光板来软化光线，保持ISO在100-400之间...</p>
        </div>
      </div>
  
      <!-- 互动操作区 -->
      <div class="action-bar">
        <button class="like-btn" @click="handleLike">👍 点赞({{ like }})</button>
        <div class="share-buttons">
          <span>分享到：</span>
          <button class="share-btn wechat">微信</button>
          <button class="share-btn weibo">微博</button>
        </div>
      </div>
  
      <!-- 评论区域 -->
      <div class="comments-section">
        <h2>用户评论（2）</h2>
        <div class="comment-list">
          <div class="comment-item">
            <div class="comment-header">
              <span class="user">摄影爱好者</span>
              <span class="time">2024-03-15 14:23</span>
            </div>
            <p class="content">非常实用的教程，光线运用讲得很透彻！</p>
          </div>
          <div class="comment-item">
            <div class="comment-header">
              <span class="user">美食达人</span>
              <span class="time">2024-03-15 16:45</span>
            </div>
            <p class="content">请问用什么型号的相机比较好？</p>
          </div>
        </div>
  
        <!-- 评论输入 -->
        <div class="comment-input">
          <textarea placeholder="写下你的评论..." rows="3"></textarea>
          <button class="submit-btn">提交评论</button>
        </div>
      </div>
    </div>
  </template>
  
  <script setup>
  import { ref,onMounted } from 'vue';

  let  like = ref(360)
  const handleLike = () => {
    like.value++
  }
  console.log(like.value);
  
  
  
  </script>
  
  <style scoped>
  .article-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 30px;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #fff;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  margin-top: 30px;
}

.article-header {
  margin-bottom: 50px;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 25px;
}

.title {
  font-size: 2.5rem;
  color: #2c3e50;
  margin-bottom: 20px;
  font-weight: 650;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.meta-info {
  color: #7f8c8d;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 30px;
}

.meta-info span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.meta-info span::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  background: #bdc3c7;
  border-radius: 50%;
  margin-right: 8px;
}

.content-img {
  width: 100%;
  height: 450px;
  object-fit: cover;
  border-radius: 12px;
  margin: 40px 0;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.content-img:hover {
  transform: translateY(-3px);
}

.content-text {
  line-height: 1.7;
  font-size: 1.1rem;
  color: #34495e;
  max-width: 680px;
  margin: 0 auto;
}

.content-text h2 {
  color: #2c3e50;
  margin: 40px 0 20px;
  padding-left: 12px;
  border-left: 4px solid #3498db;
  font-weight: 600;
}

.action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 25px 0;
  margin: 50px 0;
  border-top: 2px solid #f8f9fa;
  border-bottom: 2px solid #f8f9fa;
}

.like-btn {
  background: #fff;
  border: 2px solid #e74c3c;
  color: #e74c3c;
  padding: 10px 25px;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.like-btn:hover {
  background: #e74c3c;
  color: white;
  transform: scale(1.05);
}

.share-btn {
  padding: 9px 20px;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  background: #f8f9fa;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.share-btn:hover {
  background: #f0f2f5;
  transform: translateY(-1px);
}

.share-btn.wechat {
  color: #2dbe3f;
  border-color: #d0f4d7;
}

.share-btn.weibo {
  color: #e6162d;
  border-color: #ffe1e4;
}

.comments-section {
  margin-top: 60px;
}

.comments-section h2 {
  color: #2c3e50;
  font-size: 1.4rem;
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 2px solid #f8f9fa;
}

.comment-item {
  padding: 20px;
  background: #fafcff;
  border-radius: 10px;
  margin-bottom: 20px;
  border: 1px solid #f0f3f7;
  transition: transform 0.2s ease;
}

.comment-item:hover {
  transform: translateX(5px);
}

.comment-header {
  color: #7f8c8d;
  font-size: 0.9rem;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 15px;
}

.comment-header .user {
  color: #3498db;
  font-weight: 500;
}

.comment-input textarea {
  width: 100%;
  padding: 16px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  margin: 20px 0;
  resize: vertical;
  min-height: 100px;
  transition: border-color 0.3s ease;
}

.comment-input textarea:focus {
  border-color: #3498db;
  outline: none;
  box-shadow: 0 2px 8px rgba(52, 152, 219, 0.1);
}

.submit-btn {
  background: #3498db;
  color: white;
  padding: 12px 30px;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.submit-btn:hover {
  background: #2980b9;
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .article-page {
    padding: 25px 15px;
    margin-top: 15px;
  }
  
  .title {
    font-size: 2rem;
  }
  
  .content-img {
    height: 300px;
    margin: 30px 0;
  }
  
  .action-bar {
    flex-direction: column;
    gap: 20px;
    align-items: flex-start;
  }
}
  </style>